package com.prj.ufdm.cloud.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;

/**
 * 自定义路由规则
 * @author Administrator
 *
 */
@Configuration
public class RuleConfig {
    
	@Autowired
	IClientConfig config;
	
	@Bean
	public IRule ribbonRule(IClientConfig config) {
		
		// 随机
//		return new RandomRule();
		// 轮循
		return new RoundRobinRule();
	}
}
